package com.ysu.yybk.controller;

import com.ysu.yybk.VO.ResultVO;
import com.ysu.yybk.entity.checkin.CheckinError;
import com.ysu.yybk.form.ErrorFrom;
import com.ysu.yybk.service.CheckinErrorService;
import com.ysu.yybk.util.ResultVOUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/checkin")
public class CheckinController {

    @Autowired
    private CheckinErrorService errorService;

    @PostMapping("/writeError")
    public ResultVO writeError(@RequestBody ErrorFrom errorFrom) {
        errorService.writeError(errorFrom);
        return ResultVOUtil.success();
    }
}
